package com.atguigu.gmall.product.service.impl;


import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ClassName: BaseTrademarkServiceImpl
 * Package: com.atguigu.gmall.product.service.impl
 * Description:
 *
 * @Author 刘轩
 * @Create 2023-08-18 21:04
 * @Version 1.0
 */

@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper,BaseTrademark> implements BaseTrademarkService {

    @Autowired
    private BaseTrademarkMapper baseTrademarkMapper;
    /**
     * 分页查询品牌信息
     * @param baseTrademarkPage
     * @return
     */
    @Override
    public IPage<BaseTrademark> getTradeMarkList(Page<BaseTrademark> baseTrademarkPage) {
         // Select * from base_trademark order by id desc limit 2,2;
        LambdaQueryWrapper<BaseTrademark> baseTrademarkLambdaQueryWrapper = new LambdaQueryWrapper<>();
        baseTrademarkLambdaQueryWrapper.orderByDesc(BaseTrademark::getId);

        return baseTrademarkMapper.selectPage(baseTrademarkPage,baseTrademarkLambdaQueryWrapper);
    }

}
